package com.irdstudio.efp.flow.enumeration;

import java.util.Arrays;
import java.util.Objects;

import com.irdstudio.basic.framework.core.constant.SequenceConstance;

public enum BizSequenceType {

	
	/**
	 * 白名单导入批次流水号
	 */
	SEQ_01(SequenceConstance.PRELIST_BATCH_APP_ID), 
	
	/**
	 * 预授信名单流水号
	 */
	SEQ_02(SequenceConstance.PRELIST_TMP_ID), 
	
	/**
	 * 提额业务申请流水号
	 */
	SEQ_03(SequenceConstance.LMT_MOD_ID), 
	
	/**
	 * 业务流水号
	 */
	SEQ_04(SequenceConstance.BIZ_SERNO),
	
	/**
	 * 担保合同编号
	 */
	SEQ_05(""),
	
	/**
	 * 担保编号
	 */
	SEQ_06(SequenceConstance.GUAR_SERNO),
	
	/**
	 * 担保id
	 */
	SEQ_07(SequenceConstance.GUAR_ID),
	
	/**
	 * 借款合同编号
	 */
	SEQ_08(SequenceConstance.LOAN_CONT_SEQ_ID),
	
	/**
	 * 借据号
	 */
	SEQ_09(SequenceConstance.LOAN_BILL_SEQ_ID),
	
	/**
	 * 授信协议编号
	 */
	SEQ_10(SequenceConstance.CREDIT_AGREE_SEQ_ID),
	
	/**
	 * 授信台账编号
	 */
	SEQ_11(SequenceConstance.CREDIT_LEDGER_SEQ_ID),
	
	/**
	 * 风险分类任务编号
	 */
	SEQ_12(SequenceConstance.RSC_TASK_NO),
	
	/**
	 * 贷后检查
	 */
	SEQ_13(SequenceConstance.PSP_BIZ_SERNO),
	
	/**
	 * 默认
	 */
	DEFAULT(SequenceConstance.DEFAULT_SEQ_ID);
	
	
	private String value;
	
	private BizSequenceType(String value) {
		this.value = value;
	}
	
	public String getValue() {
		return this.value;
	}
	
	public static final String getSequenceIdByScene(String scene) {
		BizSequenceType type = Arrays.asList(BizSequenceType.values()).parallelStream().filter(s -> s.toString().equals("SEQ_"+ scene)).findFirst().orElse(null);
		if (Objects.nonNull(type)) {
			return type.getValue();
		}
		return BizSequenceType.DEFAULT.getValue();
	}
	
}
